Component({
    properties: {
        params: {
            type: null
        }
    },
    data: {
        hascolor: "",
        colorshow: ""
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {},
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        toggle: function(t) {
            var e = "";
            switch (t.currentTarget.dataset.idx) {
              case 1:
                this.setData({
                    hascolor: 1
                }), "1_2" == this.data.colorshow ? (this.setData({
                    colorshow: "1_1"
                }), e = "comment_num", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "asc"
                })) : (this.setData({
                    colorshow: "1_2"
                }), e = "comment_num", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "desc"
                }));
                break;

              case 2:
                this.setData({
                    hascolor: 2
                }), "2_2" == this.data.colorshow ? (this.setData({
                    colorshow: "2_1"
                }), e = "show_sales", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "asc"
                })) : (this.setData({
                    colorshow: "2_2"
                }), e = "show_sales", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "desc"
                }));
                break;

              case 3:
                this.setData({
                    hascolor: 3
                }), "3_2" == this.data.colorshow ? (this.setData({
                    colorshow: "3_1"
                }), e = "price", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "asc"
                })) : (this.setData({
                    colorshow: "3_2"
                }), e = "price", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "desc"
                }));
                break;

              case 5:
                this.setData({
                    hascolor: 5
                }), "5_2" == this.data.colorshow ? (this.setData({
                    colorshow: "5_1"
                }), e = "id", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "asc"
                })) : (this.setData({
                    colorshow: "5_2"
                }), e = "id", this.triggerEvent("sortIn", {
                    order_field: e,
                    order_by: "desc"
                }));
            }
        }
    }
});